import App from './App'

// #ifndef VUE3
import Vue from 'vue'


import './uni.promisify.adaptor'
Vue.config.productionTip = false
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
import shareMenuMixin from './utils/mixin.js';
import request from 'utils/request.js'

Vue.mixin(shareMenuMixin);
Vue.prototype.$request = request.request
Vue.prototype.$uploadimg = request.uploadimg
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// 获取更新管理器
const updateManager = uni.getUpdateManager();
updateManager.onUpdateReady(function (res) {
  uni.showModal({
    title: '更新提示',
    content: '新版本已经准备好，是否重启应用？',
    success(res) {
      if (res.confirm) {
        // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
        updateManager.applyUpdate();
      }
    }
  });
});
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif